package com.youtills.core.crypto;

/**
 * Created by IntelliJ IDEA.
 * User: ravi
 * Date: 8/29/12
 * Time: 11:36 AM
 * To change this template use File | Settings | File Templates.
 */
public class CipherFactory {


    public static ICipher getCipher(CipherType cipherType, String secretKey){

        switch(cipherType){
            case DES_ECB_PKCS5:
                return new DES_ECB_PKCS5PaddingCipher(secretKey);
            case AES:
            	return new AesCipher( secretKey);
        }

        throw new CryptoException("No cipher available for provided algorithm.");
    }

    public static ICipher getCipher(CipherType cipherType){

        switch(cipherType){
            case DES_ECB_PKCS5:
                return new DES_ECB_PKCS5PaddingCipher();
            case AES:
            	return new AesCipher();
        }

        throw new CryptoException("No cipher available for provided algorithm.");
    }


}
